# Maintainer: Chih-Hsuan Yen <yan12125@archlinux.org>

pkgname=python-jschema-to-python
pkgver=1.2.3
pkgrel=5
pkgdesc='Generate source code for a set of Python classes from a JSON schema'
arch=(any)
url='https://github.com/microsoft/jschema-to-python'
license=(MIT)
depends=(python-attrs python-jsonpickle python-pbr)
checkdepends=(python-pytest)
source=(https://github.com/microsoft/jschema-to-python/archive/$pkgver/$pkgname-$pkgver.tar.gz)
sha256sums=('bd21ab2f541fdae809bdfd40d1f718e6bd4ee43c92eea0c99956df20a8d877d6')

export PBR_VERSION=$pkgver

build() {
  cd jschema-to-python-$pkgver
  python setup.py build
}

check() {
  cd jschema-to-python-$pkgver
  pytest
}

package() {
  cd jschema-to-python-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1 --skip-build
  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
}
